In Office Calc, you can perform calculations with current date and time values. As an example, to find out exactly how old you are in seconds or hours, follow the following steps:
Office Calc では、日付と時刻 (両方ともコンピュータの内部クロックから取得される) を表示できるだけではありません。日付と時刻を計算することもできます。たとえば、自分の年齢が何歳と何時間何分何秒であるかを正確に計算するには、次のように行います。
In a spreadsheet, enter your birthday in cell A1.
新しい白紙の表計算ドキュメントを開きます。セル A1 に誕生日を 66/4/26 のように入力します。
Enter the following formula in cell A3: =NOW()-A1
セル A3 に次の数式を入力してください: =NOW()-A1
After pressing the Enter key you will see the result in date format. Since the result should show the difference between two dates as a number of days, you must format cell A3 as a number.
Enter キーを押すと、結果が日付書式で表示されます。2 つの日付間の差を求めるのが目的であるため、セル A3 を数値書式にする必要があります。
Place the cursor in cell A3, right-click to open a context menu and choose Format Cells.
セルカーソルを A3 に置き、セルの書式を数値に変更します。そのためにはセル A3 からコンテキストメニューを(マウスの右クリックで)呼び出し、セルの書式設定... を選択します。
The dialog appears. On the tab, the "Number" category will appear already highlighted. The format is set to "General", which causes the result of a calculation containing date entries to be displayed as a date. To display the result as a number, set the number format to "-1,234" and close the dialog with the button.
セルの書式 ダイアログが開きます。数 見出しページではすでに、数値 分類が選択されています。書式が「標準」に設定されているため、日付を含む計算結果も日付として表示されます。結果を数値として表示する場合、たとえば、数値書式に「-1,234」を設定します。OK ボタンをクリックして、ダイアログを閉じます。
The number of days between today's date and the specified date is displayed in cell A3.
セル A3 には、入力した日付から今日までの日数が表示されます。
Experiment with some additional formulas: in A4 enter =A3*24 to calculate the hours, in A5 enter =A4*60 for the minutes, and in A6 enter =A5*60 for seconds. Press the Enter key after each formula.
さらに希望に応じて次の数式が使用できます。時間の計算には数式 =A3*24 をセル A4 に、分の計算には数式 =A4*60 をセル A5 に、そして秒の計算には数式 =A5*60 をセル A6 に入力して確定します。
The time since your date of birth will be calculated and displayed in the various units. The values are calculated as of the exact moment when you entered the last formula and pressed the Enter key. This value is not automatically updated, although "Now" continuously changes. In the Tools menu, the menu item Cell Contents - AutoCalculate is normally active; however, automatic calculation does not apply to the function NOW. This ensures that your computer is not solely occupied with updating the sheet.
これで、誕生日から今現在までの期間がさまざまな単位計算されて表示されました。計算の際、秒数はセル A6 に数式を入れて Enter キーを押して確定した時点の値が採用されます。NOW の値は刻々変わるものですが、この計算結果は更新されません。メニュー ツール の セルの内容 → 自動計算 コマンドが標準設定ではオンになっていますが、それは関数 NOW には適用されません。それは、この値の更新のみにコンピュータが作動していないといけなくなるためです。